package com.cyq.day13.knightgame;

public class Map {
    int[] map = new int[100];
    int[] luckyTurn = {6, 23, 40, 55, 69, 83};//幸运轮盘
    int[] landMine = {5, 13, 17, 33, 38, 50, 64, 80, 94};//地雷位置
    int[] pause = {9, 27, 60, 93};//暂停
    int[] timeTunnel = {20, 25, 45, 63, 72, 88, 90};//时空隧道

    public void creatMap() {
        //0为正常，1为轮盘，2为地雷，3为暂停，4为时空隧道
        for (int i = 0; i < 100; i++) {
            if (i == luckyTurn[0] || i == luckyTurn[1] || i == luckyTurn[2] || i == luckyTurn[3] || i == luckyTurn[4] || i == luckyTurn[5]) {
                map[i] = 1;
            }
            if (i == landMine[0] || i == landMine[1] || i == landMine[2] || i == landMine[3] || i == landMine[4] || i == landMine[5] || i == landMine[6] || i == landMine[7] || i == landMine[8]) {
                map[i] = 2;
            }
            if (i == pause[0] || i == pause[1] || i == pause[2] || i == pause[3]) {
                map[i] = 3;
            }
            if (i == timeTunnel[0] || i == timeTunnel[1] || i == timeTunnel[2] || i == timeTunnel[3] || i == timeTunnel[4] || i == timeTunnel[5] || i == timeTunnel[6]) {
                map[i] = 4;
            }
        }
    }

    public void showBeginMap() {
        for (int i = 0; i < 31; i++) {
            if (map[i] == 0) {
                System.out.print("::");
            } else if (map[i] == 1) {
                System.out.print("xx");
            } else if (map[i] == 2) {
                System.out.print("**");
            } else if (map[i] == 3) {
                System.out.print("!!");
            } else if (map[i] == 4) {
                System.out.print("==");
            }
        }
        System.out.println();
        for (int i = 31; i < 35; i++) {
            if (map[i] == 0) {
                System.out.println("                                                            " + "::");
            } else if (map[i] == 1) {
                System.out.println("                                                            " + "xx");
            } else if (map[i] == 2) {
                System.out.println("                                                            " + "**");
            } else if (map[i] == 3) {
                System.out.println("                                                            " + "!!");
            } else if (map[i] == 4) {
                System.out.println("                                                            " + "==");
            }
        }

        for (int i = 66; i > 35; i--) {
            if (map[i] == 0) {
                System.out.print("::");
            } else if (map[i] == 1) {
                System.out.print("xx");
            } else if (map[i] == 2) {
                System.out.print("**");
            } else if (map[i] == 3) {
                System.out.print("!!");
            } else if (map[i] == 4) {
                System.out.print("==");
            }
        }
        System.out.println();
        for (int i = 66; i < 69; i++) {
            if (map[i] == 0) {
                System.out.println("::");
            } else if (map[i] == 1) {
                System.out.println("xx");
            } else if (map[i] == 2) {
                System.out.println("**");
            } else if (map[i] == 3) {
                System.out.println("!!");
            } else if (map[i] == 4) {
                System.out.println("==");
            }
        }
        for (int i = 69; i < 100; i++) {
            if (map[i] == 0) {
                System.out.print("::");
            } else if (map[i] == 1) {
                System.out.print("xx");
            } else if (map[i] == 2) {
                System.out.print("**");
            } else if (map[i] == 3) {
                System.out.print("!!");
            } else if (map[i] == 4) {
                System.out.print("==");
            }

        }
    }
}
